package com.xdkj.util;

/**
 * @author Administrator
 * @version 1.0
 * @description: TODO
 * @date 2021/11/24 16:32
 */

public class BaseResponse {
    private Integer code;
    private String massage;
    private Object data;

    public static BaseResponse ok(){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(2000);
        baseResponse.setMassage(null);
        baseResponse.setData(null);
        return baseResponse;
    }
    public static BaseResponse ok(int code){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(code);
        baseResponse.setMassage(null);
        baseResponse.setData(null);
        return baseResponse;
    }
    public static BaseResponse ok(int code,String massage){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(code);
        baseResponse.setMassage(massage);
        baseResponse.setData(null);
        return baseResponse;
    }
    public static BaseResponse ok(int code,String massage,Object data){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(code);
        baseResponse.setMassage(massage);
        baseResponse.setData(data);
        return baseResponse;
    }
    public static BaseResponse error(){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(2000);
        baseResponse.setMassage(null);
        baseResponse.setData(null);
        return baseResponse;
    }
    public static BaseResponse error(int code){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(code);
        baseResponse.setMassage(null);
        baseResponse.setData(null);
        return baseResponse;
    }
    public static BaseResponse error(int code,String massage){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(code);
        baseResponse.setMassage(massage);
        baseResponse.setData(null);
        return baseResponse;
    }
    public static BaseResponse error(int code,String massage,Object data){
        BaseResponse baseResponse = new BaseResponse();
        baseResponse.setCode(code);
        baseResponse.setMassage(massage);
        baseResponse.setData(data);
        return baseResponse;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMassage() {
        return massage;
    }

    public void setMassage(String massage) {
        this.massage = massage;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
